package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.commom.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.model.hosp.Department;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author mengWu
 * @Date 2021年05月21日 15:14
 */
@Api(tags = "科室管理")
@RestController
@RequestMapping("admin/hosp/department")
//@CrossOrigin
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院编号查询科室接口
    @ApiOperation(value = "根据医院编号查询科室接口")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> departmentList = departmentService.findDeptTree(hoscode);

        return Result.ok(departmentList);
    }
}
